import request from '@/utils/request'

// 检查类型字典
export function getCheckType(query) {
  return request({
    url: '/check/governDict/getCheckType',
    method: 'get',
    params: query
  })
}
// 新增选择任务列表
export function governCheckTask(query) {
  return request({
    url: '/check/governCheckTask/distinct/list',
    method: 'get',
    params: query
  })
}
// 任务分解
export function taskSalvage(query) {
  return request({
    url: '/check/governCheckTaskInfo/taskSalvage',
    method: 'get',
    params: query
  })
}

// 查询检查项
export function governCheckTaskItem(query) {
  return request({
    url: '/check/governCheckTaskItem/list',
    method: 'get',
    params: query
  })
}

// 查询扣分项
export function governCheckTaskItemId(governCheckTaskItemId) {
  return request({
    url: '/check/governCheckTaskItemScore/get/' + governCheckTaskItemId,
    method: 'get',
  })
}

// 所属装置
export function getDeviceLevel(query) {
  return request({
    url: '/preventionDevice/listByLevel',
    method: 'get',
    params: query
  })
}

// 隐患来源
export function getHiddenSource(query) {
  return request({
    url: '/check/governDict/getHiddenSource',
    method: 'get',
    params: query
  })
}

// 隐患排查级别
export function getCheckLevel(query) {
  return request({
    url: '/check/governDict/getCheckLevel',
    method: 'get',
    params: query
  })
}

// 隐患类型
export function getHiddenType(query) {
  return request({
    url: '/check/governDict/getHiddenType',
    method: 'get',
    params: query
  })
}

// 隐患治理级别
export function getHiddenLevel(query) {
  return request({
    url: '/check/governDict/getHiddenLevel',
    method: 'get',
    params: query
  })
}
// 危害类型
export function getWeiHaiType(query) {
  return request({
    url: '/check/governDict/getWeiHaiType',
    method: 'get',
    params: query
  })
}
// 隐患治理类型
export function getZhiLiType(query) {
  return request({
    url: '/check/governDict/getZhiLiType',
    method: 'get',
    params: query
  })
}


// 查询政府专项检查列表
export function listGovernCheckTaskInfo(query) {
  return request({
    url: '/check/governCheckTaskInfo/list',
    method: 'get',
    params: query
  })
}

// 新增政府专项检查
export function addGovernCheckTaskInfo(data) {
  return request({
    url: '/check/governCheckTaskInfo/saveTaskInfo',
    method: 'post',
    data: data
  })
}

// 新增政府专项检查
export function getGovernTaskInfo(governTaskInfoId) {
  return request({
    url: '/check/governCheckTaskInfo/' + governTaskInfoId,
    method: 'get'
  })
}

// 修改任务状态
export function modifyGovernCheckTaskInfo(data) {
  return request({
    url: '/check/governCheckTaskInfo',
    method: 'put',
    data: data
  })
}


// 删除政府专项检查
export function delGovernCheckTaskInfo(governTaskInfoIds) {
  return request({
    url: '/check/governCheckTaskInfo/' + governTaskInfoIds,
    method: 'delete',
  })
}

// 隐患录入提交按钮
export function governHiddenInventory(data) {
  // console.log(JSON.stringify(data));
  return request({
    url: '/check/governHiddenInventory',
    method: 'post',
    data: data
  })
}

// 隐患录入提交按钮
export function putGovernHiddenInventory(data) {
  return request({
    url: '/check/governHiddenInventory',
    method: 'put',
    data: data
  })
}